import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { UserSwitchOutlined } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/labor',
    name: 'Labor',
    redirect: '/labor/list',
    component: Layout,
    meta: {
      title: '劳务管理',
      icon: renderIcon(UserSwitchOutlined),
      sort: 5,
    },
    children: [
      {
        path: 'company',
        name: 'labor-company-register',
        meta: {
          title: '劳务公司登记',
        },
        children: [
          {
            path: 'register',
            name: 'labor-company-register',
            meta: {
              title: '劳务公司登记',
            },
            component: () => import('@/views/laborCompany/basicList/register.vue'),
          },
          {
            path: 'contract',
            name: 'labor-company-contract',
            meta: {
              title: '劳务公司合同',
            },
            component: () => import('@/views/laborCompany/basicList/contract.vue'),
          },
          {
            path: 'contract/info/:id?',
            name: 'labor-company-contract-info',
            meta: {
              title: '劳务公司合同',
              hidden: true,
              activeMenu: 'laborCompanyContractInfo',
            },
            component: () => import('@/views/laborCompany/form/contract.vue'),
          },
          {
            path: 'register/info/:id?',
            name: 'labor-company-register-info',
            meta: {
              title: '劳务公司登记',
              hidden: true,
              activeMenu: 'laborCompanyRegisterInfo',
            },
            component: () => import('@/views/laborCompany/form/register.vue'),
          },
        ],
      },
      {
        path: 'teams/register',
        name: 'labor-teams-register',
        meta: {
          title: '劳务班组登记',
        },
        children: [
          {
            path: 'register',
            name: 'teams-register',
            meta: {
              title: '劳务班组登记',
            },
            component: () => import('@/views/teams/basicList/register.vue'),
          },
          {
            path: 'list',
            name: 'teams-list',
            meta: {
              title: '劳务班组合同',
            },
            component: () => import('@/views/teams/basicList/contract.vue'),
          },
          {
            path: 'info/:id?',
            name: 'teams-info',
            meta: {
              title: '劳务班组合同',
              hidden: true,
              activeMenu: 'teamsInfo',
            },
            component: () => import('@/views/teams/form/contract.vue'),
          },
          {
            path: 'register/info/:id?',
            name: 'teams-register-info',
            meta: {
              title: '劳务班组登记',
              hidden: true,
              activeMenu: 'teamsRegisterInfo',
            },
            component: () => import('@/views/teams/form/register.vue'),
          },
        ],
      },
      {
        path: 'list',
        name: 'labor-list',
        meta: {
          title: '人员信息表',
        },
        component: () => import('@/views/labor/basicList/index.vue'),
      },
      {
        path: 'blacklist',
        name: 'labor-blacklist',
        meta: {
          title: '黑名单',
        },
        component: () => import('@/views/labor/basicList/blacklist.vue'),
      },
      {
        path: 'sign',
        name: 'labor-sign',
        meta: {
          title: '人员考勤',
        },
        component: () => import('@/views/labor/basicList/index.vue'),
      },
      {
        path: 'exit',
        name: 'labor-exit',
        meta: {
          title: '退场登记',
        },
        component: () => import('@/views/labor/basicList/exit.vue'),
      },
      {
        path: 'salary',
        name: 'labor-salary',
        meta: {
          title: '工资汇总',
        },
        component: () => import('@/views/labor/basicList/salary.vue'),
      },
      {
        path: 'info/:id?',
        name: 'labor-info',
        meta: {
          title: '劳务人员信息',
          hidden: true,
          activeMenu: 'laborInfo',
        },
        component: () => import('@/views/labor/basicList/info.vue'),
      },
      {
        path: 'month_attendance/:id',
        name: 'labor-month_attendance',
        meta: {
          hidden: true,
          title: '月份考勤合计表',
        },
        component: () => import('@/views/labor/basicList/month_attendance.vue'),
      },
      {
        path: 'attendance',
        name: 'labor-attendance',
        meta: {
          title: '劳务人员出勤BI统计表',
        },
        component: () => import('@/views/labor/basicList/attendance.vue'),
      },
      {
        path: 'public_security',
        name: 'labor-public_security',
        meta: {
          title: '对接公安系统',
        },
        component: () => import('@/views/labor/basicList/public_security.vue'),
      },
      {
        path: 'temporary',
        name: 'labor-temporary',
        meta: {
          title: '临时用工信息表',
        },
        component: () => import('@/views/labor/basicList/temporary.vue'),
      },
    ],
  },
];

export default routes;
